-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add env name into test, and replace comons.fixtureDir with comm.fixtures #15816
Conversation
@@ -10,7 +11,7 @@ const path = require('path'); | |||
|
|||
// piping should work as expected with createWriteStream | |||
|
|||
const loc = path.join(common.fixturesDir, 'person.jpg'); | |||
const loc = path.join(fixtures.fixturesDir, 'person.jpg'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be using method fixtures.path
instead of path.join
.
4bb4807
to
26f3492
Compare
@@ -10,8 +11,8 @@ const path = require('path'); | |||
|
|||
// piping should work as expected with createWriteStream | |||
|
|||
const loc = path.join(common.fixturesDir, 'person.jpg'); | |||
const fn = path.join(common.tmpDir, 'http2pipe.jpg'); | |||
const loc = fixtures.path(fixtures.fixturesDir, 'person.jpg'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please have a look at fixtures.path
definition you will see that you don't have to pass the fixturesDir anymore.
const loc = path.join(common.fixturesDir, 'person.jpg'); | ||
const fn = path.join(common.tmpDir, 'http2pipe.jpg'); | ||
const loc = fixtures.path(fixtures.fixturesDir, 'person.jpg'); | ||
const fn = fixtures.path(common.tmpDir, 'http2pipe.jpg'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be unchanged as it's not related to fixtures.
26f3492
to
0c38a4e
Compare
@pawelgolda PTAL |
@shaohui-liu2000 looks good. |
@@ -45,5 +45,5 @@ child.stdout.on('data', function(chunk) { | |||
|
|||
process.on('exit', function() { | |||
assert.ok(response.includes('HELLO=WORLD'), | |||
'spawn did not use process.env as default'); | |||
`spawn did not use process.env as default(process.env.HELLO = ${process.env.HELLO})`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter doesn't like this long line :-(
It can be fixed by shortening the line a bit or by adding an eslint directive to the top of the file (near 'use strict';
) with something like /* eslint-disable max-len */
(you can see examples of this being done in other tests, such as test/parallel/test-readline-keys.js
and test/parallel/test-require-extensions-same-filename-as-dir-trailing-slash.js
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could disable the rule, but you shouldn't ;-). The line needs wrapping. This can be seen locally by calling make eslint
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this line to something like:
'spawn did not use process.env as default' +
`(process.env.HELLO = ${process.env.HELLO})`);
so we don't have to disable the eslint rule?
@@ -1,6 +1,7 @@ | |||
'use strict'; | |||
|
|||
const common = require('../common'); | |||
const fixtures = require('../common/fixtures'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you please move this after the common.hasCrypto
check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh..now after the update there are two fixtures
. I don't think it can run with two const fixtures
defined? Can you remove this line?
This should be landed as two commits. |
@sam-github @rmg @lpinca - PTAL. |
PR-URL: #15816 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15816 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs/node#15816 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: nodejs/node#15816 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15816 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
PR-URL: #15816 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes(https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#commit-message-guidelines)
Affected core subsystem(s)
test